Talk:Knight Maze
Awesome! This sounds like a really great game, and I really can't wait to try it. Out of curiosity, how do you save the map? You said in a list, I was just wondering how you stored the data. LordoftheBleak 17:24, April 26, 2012 (UTC) :Oh lol I just looked at the code. Just a thought: if you leave one row of blocks filled on each border (and an extra pixel line on each horizontal border), it leaves 551 3x3 blocks that can be filled or empty. That is two states, on or off, or 1 or 0. The highest binary number that is one digit in decimal and is a multiple of two is 8. So, the numbers zero through seven can be converted into a three digit binary number, where each digit is the state of a single 3x3 block. A single map would take one digit in exactly a 184 dimensioned list. Each list item can have twenty digits (ten real, ten imaginary). So, you can store twenty different maps in 184 list items. A single list can have 999 items, so depending on how much memory you want to allocate for it, you could store 100 maps in one list. However, the amount of memory for that one list would be enormous, especially because it uses imaginary numbers. I would stop at twenty, but by using more custom lists, and archiving and unarchiving them at need, you could create as many maps as you wanted, storing twenty in each different list. You could add an extra item, making the list 185 long, and make the last one the coordinates of the start and end points. It would probably take longer to save and restore each map, but all twenty maps would take less memory than if someone filled up a map completely with blocks and saved it in the system used right now. I just thought of this, but if you wanted more maps in the same amount of space, the decimal points could act as another digit, giving you twenty two maps in the one list. LordoftheBleak 18:00, April 26, 2012 (UTC) :Glad you're interested! I found that when I made the random map generator I rarely ever make my own maps. However, I'm working on an idea that would allow you to draw a path and then randomly fill the place with blocks afterwards. I'll post my random map generator in the next couple of hours (I hope). :But yes, as of now, I have them saved in a list and it saves it as you create it. I can't think of a way to "name" maps as you save them. So even if you wanted to make a second map, you'd have to go in and change the list name for every map you wanted to use. And then to recall it, you'd have to do the same thing. :Rianbay812 03:21, April 28, 2012 (UTC) ::I don't think it is possible to change list names without doing it manually. I know how to recall any list you want from user input, but you can't create a custom named list without typing it into the code. But, if you create lists just for that purpose, you can save maps into them. You could, for example, make KNGT1 through KNGT5, or however many you wanted. You couldn't name the lists after whatever map you save in them, but you could save that name into the list, and use that name, or the list's name, to recall it. LordoftheBleak 04:49, April 28, 2012 (UTC)